//接口
// interface 关键字
interface Inf{
  name?:string//？可选属性
  readonly age:string//只读属性
  [propsName:string]:string|undefined//任意属性,它的值的类型只能是可选类型,默认类型中他们的类型
}


//对象接口
interface Iobj  {
  naem:string
  age:number
}
let obj:Iobj = {
  naem:'程凯',
  age:20
} 

// 索引数组接口
interface Iindex {
  [index:number]:string|number
}
let ind:Iindex = ['1',2] 

//索引对象接口
interface IindObj {
  [index:string]:string
}
let obj1 = {name:'艾伦',lova:'无'}

//函数接口
interface Ifn {
  (str:string):void
}

let myMethod:Ifn =(str):void=>{
  return void 0 // 函数中返回值还是再写一遍,否则不生效
}

myMethod('三笠');


//接口类

interface Iperson {
  name:string
  age:number
}

class Person implements Iperson {
  name='三笠';
  age=123;
}


//接口继承
interface Iw {
  age:number
}
interface Ih extends Iw {
  name:string
}
let obj2:Ih = {
  name:'福禄克',
  age:123
}

//规定多个接口

interface Iw1 {
  age:number
}
interface Iweight {
  bold:string
}
interface Ih1 extends Iw1,Iweight {
  name:string
}
let obj3:Ih1 = {
  name:'福禄克',
  age:123,
  bold:'130'
}

//接口继承可以同样类也可以继承多个接口
interface a {
  w:string
}
interface b {
  h:string
}
class people implements a,b {
  w='100';
  h='100';
}

//继续推我们接口可以继承接口我们类也可以继承接口


